#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include<string>
using namespace std;

int main() {
	string S1;
	getline(cin, S1);
	size_t pos = S1.rfind(' ');
	cout << S1.size() - pos - 1 << endl;
	return 0;
}